<!-- 封面背景图片 -->
<div class="layui-carousel" id="test1" position="relative">


    <div carousel-item>
        {if condition="$LoginUser.cover"}
        {foreach $cover as $item}
        <div>
            <img src="{$item}" width="100%" alt="">
        </div>
        {/foreach}
        {/if}
    </div>


    <div class="fly-home fly-panel" style=" position:absolute; top:0; left:0;width: 100%; background:transparent">
        <!-- 头像 -->
        {if condition="$Think.cookie.LoginUser['avatar']"}
        <img src="{$Think.cookie.LoginUser['avatar']}" />
        {else /}
        <img src="/assets/home/images/avatar.jpg" />
        {/if}

        <!-- 认证信息 -->
        {if condition="$Think.cookie.LoginUser['auth'] eq 1"}
        <i class="iconfont icon-renzheng layui-hide-xs"></i>
        {/if}

        <h1>
            <!-- 昵称 -->
            {$Think.cookie.LoginUser['nickname']}

            <!-- 性别 -->
            {if condition="$LoginUser.sex eq 1"}
            <i class="iconfont icon-nan"></i>
            {elseif condition="$LoginUser.sex eq 2" /}
            <i class="iconfont icon-nv"></i>
            {/if}

            <!-- VIP -->
            {if condition="$LoginUser['vip'] gt 0"}
            <i class="layui-badge fly-badge-vip">
                VIP{$LoginUser['vip']}
            </i>
            {/if}
        </h1>

        <p class="fly-home-info">
            <!-- 积分 -->
            <i class="iconfont icon-kiss" title="飞吻" style="color: #fff;"></i>
            <span style="color: #fff;">{$LoginUser.point} 积分</span>

            <!-- 时间 -->
            <i class="iconfont icon-shijian" style="color: #fff;"></i><span
                style="color: #fff;">{$LoginUser.createtime}</span>

            <!-- 地区 -->
            <i class="iconfont icon-chengshi" style="color: #fff;"></i><span
                style="color: #fff;">来自{$LoginUser.region_text}</span>
        </p>

        {if condition="$LoginUser.content"}
        <p class="fly-home-sign" style="color: #fff;">{$LoginUser.content}</p>
        {else /}
        <p class="fly-home-sign" style="color: #fff;">这个人很懒什么都没写</p>
        {/if}

        <div class="fly-sns" data-user="">
            <a href="javascript:;" class="layui-btn layui-btn-primary fly-imActive" data-type="addFriend">加为好友</a>
            <a href="javascript:;" class="layui-btn layui-btn-normal fly-imActive" data-type="chat">发起会话</a>
        </div>

    </div>
</div>



<div class="layui-container" style="padding-top: 40px;">
    <div class="layui-row layui-col-space15">

        <!-- 左侧提问 -->
        <div class="layui-col-md6 fly-home-jie">
            <div class="fly-panel">
                <h3 class="fly-panel-title">{$Think.cookie.LoginUser['nickname']} 最近的提问</h3>
                <ul class="jie-row">
                    {foreach $postlist as $item}
                    <li>
                        {if condition="$item.state eq 1"}
                        <span class="layui-badge layui-bg-black">置顶</span>
                        {elseif condition="$item.state eq 2"}
                        <span class="layui-badge layui-bg-red">精华</span>
                        {elseif condition="$item.state eq 3"}
                        <span class="layui-badge layui-bg-orange">热门</span>
                        {/if}

                        <a href="{:url('home/index/info',['postid'=>$item.id])}" class="jie-title">{$item.title}</a>
                        <i>{$item.createtime}</i>
                        {if condition="!$item.visit"}
                        <em>无人阅读/{$item.comment_total}人评论</em>
                        {else if condition="$item.visit"}
                        <em>{$item.visit_total}人阅读/{$item.comment_total}评论</em>
                        {/else}
                        {/if}
                    </li>

                    {/foreach}
                    {if condition='!$postlist'}
                    <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><i
                            style="font-size:14px;">没有发表任何求解</i>
                    </div>
                    {/if}
                </ul>



            </div>
        </div>



        <!-- 右侧回答 -->
        <div class="layui-col-md6 fly-home-da">
            <div class="fly-panel">
                <h3 class="fly-panel-title">{$LoginUser['nickname']}最近的回答</h3>



                <ul class="home-jieda">
                    {foreach $commentlist as $item}
                    <li>
                        <p>
                            <span>{$item.createtime}</span>
                            在<a target="_blank">tips能同时渲染多个吗?</a>中回答：
                        </p>
                        <div class="home-dacontent">
                            尝试给layer.photos加上这个属性试试：
                            <pre>full: true         </pre>
                            文档没有提及
                        </div>
                    </li>
                    {/foreach}
                    <!-- <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><span>没有回答任何问题</span></div> -->
                </ul>
            </div>
        </div>

    </div>
</div>
<script>
    layui.use('carousel', function () {
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#test1'
            , width: '100%' //设置容器宽度
            , arrow: 'always' //始终显示箭头
            // ,anim: 'fade' //切换动画方式
            , height: '350px' //
        });
    });
</script>